﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace BLL
{
    public class SizeTempleteBLL
    {
        private readonly DAL.SizeTempleteDAL sizetempletedal = new DAL.SizeTempleteDAL();
        /// <summary>
        ///根据itemid获取尺寸信息模板 
        /// </summary>
        /// <param name="itemid"></param>
        /// <returns></returns>
        public DataTable getTempleteByID(string itemid)
        {
            BLL.ItemBLL itembll = new ItemBLL();
            string stylelist = itembll.getStyleList(itemid);
            return sizetempletedal.getTemplete("styleid in ("+stylelist+")");
        }
        /// <summary>
        /// 添加尺寸模板
        /// </summary>
        /// <param name="templete"></param>
        public void addTemplete(Albon.Model.SizeTemplete templete)
        {
            sizetempletedal.addTemplete(templete);
        }

        /// <summary>
        /// 添加之前先将与该 StyleID相关的所有数据设为active=0
        /// </summary>
        /// <param name="p"></param>
        public void deleteTemplete(int styleid)
        {
            sizetempletedal.deleteTemplete(styleid);
        }
    }
}
